﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace WebProyectoSIETE
{
    public partial class elegirPersonaje : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

            lbAtaque.Text = dv.Table.Rows[0][2].ToString();
            lbVida.Text = dv.Table.Rows[0][3].ToString();
            lbDefensa.Text = dv.Table.Rows[0][4].ToString();
            lbNombrePersonaje.Text = dv.Table.Rows[0][1].ToString();
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

            lbAtaque.Text = dv.Table.Rows[int.Parse(DropDownList1.SelectedValue.ToString())-1][2].ToString();
            lbVida.Text = dv.Table.Rows[int.Parse(DropDownList1.SelectedValue.ToString())-1][3].ToString();
            lbDefensa.Text = dv.Table.Rows[int.Parse(DropDownList1.SelectedValue.ToString())-1][4].ToString();
            lbNombrePersonaje.Text = dv.Table.Rows[int.Parse(DropDownList1.SelectedValue.ToString())-1][1].ToString();

            
        }
    }
}